/**
 * Copyright &copy; 2012-2016 <a href="https://istep.lczyfz.com">Istep</a> All rights reserved.
 */
package com.lczyfz.istep.modules.race.service;

import java.util.List;

import com.lczyfz.istep.common.constants.DeleteFlag;
import com.lczyfz.istep.modules.race.entity.RaceTeam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.lczyfz.istep.common.persistence.Page;
import com.lczyfz.istep.common.service.CrudService;
import com.lczyfz.istep.modules.race.entity.RaceUser;
import com.lczyfz.istep.modules.race.dao.RaceUserDao;

/**
 * 竞赛账号管理Service
 * @author CY
 * @version 2017-04-17
 */
@Service
@Transactional(readOnly = false)
public class RaceUserService extends CrudService<RaceUserDao, RaceUser> {

	@Autowired
	RaceUserDao raceUserDao;




	public RaceUser get(String id) {
		return super.get(id);
	}
	
	public List<RaceUser> findList(RaceUser raceUser) {
		return super.findList(raceUser);
	}
	
	public Page<RaceUser> findPage(Page<RaceUser> page, RaceUser raceUser) {
		return super.findPage(page, raceUser);
	}
	
	@Transactional(readOnly = false)
	public void save(RaceUser raceUser) {
		super.save(raceUser);
	}
	
	@Transactional(readOnly = false)
	public void delete(RaceUser raceUser) {
		super.delete(raceUser);
	}

	//所以的竞赛团队
    public  List<RaceTeam> findAllClassList(){

		 return raceUserDao.findAllClassList();
	}

	 public  RaceUser findId(String id){
		 return  raceUserDao.findId(id);
	 }

     public void  inpuUserRole(RaceUser raceUser){
		 raceUserDao.inpuUserRole(raceUser);
	 }

	public void deleteUserRole(RaceUser id){
		raceUserDao.deleteUserRole(id);
	}

	public List<RaceUser> findUserRole(){
		return raceUserDao.findUserRole();
	}

	//根据登录名获取学生记录
	public RaceUser findStudentByLoginName(String loginName) {
		return raceUserDao.findStudentByLoginName(loginName, DeleteFlag.deleteFlag);
	}

	public RaceUser findByName(String loginName) {
		return raceUserDao.findByLoginName(loginName);
	}
}